package forum.communication;

import forum.server.controller.ForumFacadeInt;
import forum.server.exceptions.*;

/**
 * 
 * @author Tamir 
 */
public class ViewForumMessage extends ClientMessage {

	private static final long serialVersionUID = 923990416696133754L;

	/* (non-Javadoc)
	 * @see forum.tcpcommunicationlayer.ClientMessage#doOperation(forum.server.domainlayer.ForumFacade)
	 */
	@Override
	public ServerResponse doOperation(ForumFacadeInt forum) {
		String forum_view = "";
		try {
			forum_view = forum.viewForum();
		} catch (DatabaseException e) {
			return new ServerResponse("The server is currently down for maintanance.\n" +
                    "Please try again later.", false);
		}
		return new ServerResponse(forum_view, true);
	}

}
